package org.jackysoft.report.visitor;

import org.jackysoft.entity.ArmItem;
import org.jackysoft.report.ItemUnit;
import org.jackysoft.report.DataItemType;
import org.jackysoft.report.ReportConstant;
import org.springframework.stereotype.Component;


/**
 * 成品月报表累计访问者
 * */
@Component(ReportConstant.MonthlyFinishedProductVisitor)
public class ArmMonthlyFinishedAccumulativeVisitor 
extends AbstractArmItemVisitor {

	
	public ArmMonthlyFinishedAccumulativeVisitor() {
		super();
		// TODO Auto-generated constructor stub
	}


	public ArmMonthlyFinishedAccumulativeVisitor(ArmItem source) {
		super(source);
	}

	
	@Override
	public void visite(ItemUnit item) {
		if (getSource() == null){
			this.setSource(new ArmItem());
		}
		ArmItem source = this.getSource();
		ArmItem target = (ArmItem) item;
		DataItemType[] dts = {DataItemType.Action,DataItemType.Passed,DataItemType.Waster, DataItemType.Test};
		for (DataItemType dt : dts)
			accumulate(dt, source, target);
	}

}
